/**
 * 
 */
package tk.sunlatus.project.config.domain;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;

/**
 * @author sunlotus
 * 
 */
public class ConfigFile {

    private String type = null;

    private String key = null;

    private String path = null;

    private String refresh = null;
    
    private long lastModify = -1;

    public interface Type {
        String XML = "xml";

        String PROPERTIES = "properties";
    }

    /**
     * 文件加载方式
     * 
     * @author sunlotus
     * 
     */
   public interface RefreshType {
        // 不用刷新，修改配置后重启系统后才生效
        String REFRESH_NO = "0";

        // 实时刷新，修改文件后不需要重启系统，实时生效
        String RERESH_REAL_TIME = "1";

        // 通过定时任务刷新
        String REFRESH_BY_TASK = "2";

    }

    public void setType(String type) {
        this.type = type;
    }

    public String getType() {
        return type;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getRefresh() {
        return refresh;
    }

    public void setRefresh(String refresh) {
        this.refresh = refresh;
    }
    
    public void setLastModify(long lastModify) {
        this.lastModify = lastModify;
    }

    public long getLastModify() {
        return lastModify;
    }

    @Override
    public String toString() {
        return ReflectionToStringBuilder.toString(this);
    }
    
    
}
